home *** CD-ROM | disk | FTP | other *** search
/ Interactive CD-ROM & Web Magazine 6 / Interactive CD-ROM & Web Magazine 6.iso / pc / imm / ss / cdspec / ss.dir / 00029.ls < prev    next >
Encoding:
Text File  |  1996-04-03  |  3.2 KB  |  111 lines

  1. global hotcast, lastmc, numerocapitoli, pathSeparator, slideCounter, guardaQui, rosso, bianco, currentNetHandler, prefix
  2.  
  3. on startMovie
  4.   set rosso to the foreColor of field "rosso"
  5.   set bianco to the foreColor of field "bianco"
  6.   set lastmc to -1
  7.   set hotcast to [190, 191, 192, 193, 194, 195, 196, 197, 177, 207, 208, 209, 210]
  8.   bootstrap()
  9. end
  10.  
  11. on initSlide
  12.   set slideCounter to 1
  13.   set the foreColor of field 20 to bianco
  14.   set the foreColor of line 1 of field 20 to rosso
  15.   set ssobj to FileIO(mnew, "read", the pathName & "Slide" & pathSeparator & "01.pct")
  16.   set the picture of cast 46 to ssobj(mReadPICT)
  17.   put ssobj(mdispose)
  18.   updateStage()
  19.   sound playFile 2, the pathName & "audio" & pathSeparator & "01.aif"
  20. end
  21.  
  22. on getNextPict
  23.   set the foreColor of field 20 to bianco
  24.   set the foreColor of line slideCounter + 1 of field 20 to rosso
  25.   put slideCounter + 1
  26.   set slideCounter to slideCounter + 1
  27.   if slideCounter > numerocapitoli then
  28.     set slideCounter to numerocapitoli + 1
  29.   else
  30.     if slideCounter < 10 then
  31.       set prefix to "0" & string(slideCounter)
  32.     else
  33.       set prefix to string(slideCounter)
  34.     end if
  35.     set ssobj to FileIO(mnew, "read", the pathName & "Slide" & pathSeparator & prefix & ".pct")
  36.     set the picture of cast 46 to ssobj(mReadPICT)
  37.     put ssobj(mdispose)
  38.     updateStage()
  39.     sound playFile 2, the pathName & "audio" & pathSeparator & prefix & ".aif"
  40.   end if
  41. end
  42.  
  43. on bootstrap
  44.   set the itemDelimiter to TAB
  45.   set Obj to FileIO(mnew, "read", the pathName & "config.ss")
  46.   if not objectp(Obj) then
  47.     alert("no oggetto" & Obj)
  48.   end if
  49.   set content to Obj(mReadFile)
  50.   put Obj(mdispose)
  51.   put line 1 of content into field "titolo"
  52.   set numerocapitoli to value(line 2 of content)
  53.   set the text of field "testo" to line 3 to numerocapitoli + 2 of content & RETURN
  54. end
  55.  
  56. on vedianche
  57.   set the text of field "vedianca" to " "
  58.   if the machineType = 256 then
  59.     set suffix to "win"
  60.   else
  61.     set suffix to "mac"
  62.   end if
  63.   set Obj to FileIO(mnew, "read", the pathName & "seealso." & suffix)
  64.   if not objectp(Obj) then
  65.     alert("no oggetto" & Obj)
  66.   end if
  67.   set guardaQui to Obj(mReadFile)
  68.   put Obj(mdispose)
  69.   repeat with a = 1 to the number of lines in guardaQui
  70.     put item 1 of line a of guardaQui & RETURN after field "vedianca"
  71.   end repeat
  72. end
  73.  
  74. on placebuttons nomecast, firstsprite, numerosprites, xcoord, ycoord, deltax, deltay
  75.   repeat with a = firstsprite to firstsprite + numerosprites - 1
  76.     set the puppet of sprite a to 1
  77.     set the loc of sprite a to point(xcoord + (deltax * (a - firstsprite)), ycoord + (deltay * (a - firstsprite)))
  78.   end repeat
  79. end
  80.  
  81. on aligntextonbuttons x, y, deltay, numsprite
  82.   set the puppet of sprite numsprite to 1
  83.   set the loc of sprite numsprite to point(x, y)
  84.   set the textHeight of field the castNum of sprite numsprite to deltay
  85. end
  86.  
  87. on gherollero
  88.   set thismc to the mouseCast
  89.   if lastmc = thismc then
  90.     if getOne(hotcast, thismc) then
  91.       mousewithin(script thismc)
  92.     end if
  93.   end if
  94.   if lastmc <> thismc then
  95.     if getOne(hotcast, lastmc) then
  96.       mouseexit(script lastmc)
  97.     end if
  98.     if getOne(hotcast, thismc) then
  99.       mouseenter(script thismc)
  100.     end if
  101.     set lastmc to thismc
  102.   end if
  103. end
  104.  
  105. on idle
  106.   if the machineType = 256 then
  107.     do(currentNetHandler)
  108.   end if
  109.   gherollero()
  110. end
  111.